@keyframes processing {
  0% {
    opacity: 0.6;
    transform: scale(0);
  }

  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

.root {
  --indicator-size: 10px;
  --indicator-color: var(--mantine-primary-color-filled);

  position: relative;
  display: block;

  &:where([data-inline]) {
    display: inline-block;
  }
}

.indicator {
  position: absolute;
  top: var(--indicator-top);
  left: var(--indicator-left);
  right: var(--indicator-right);
  bottom: var(--indicator-bottom);
  transform: translate(var(--indicator-translate-x), var(--indicator-translate-y));
  min-width: var(--indicator-size);
  height: var(--indicator-size);
  border-radius: var(--indicator-radius, 1000rem);
  z-index: var(--indicator-z-index, 200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--mantine-font-size-xs);
  background-color: var(--indicator-color);
  color: var(--indicator-text-color, var(--mantine-color-white));
  white-space: nowrap;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--indicator-color);
    border-radius: var(--indicator-radius, 1000rem);
    z-index: -1;
  }

  &:where([data-with-label]) {
    padding-inline: calc(var(--mantine-spacing-xs) / 2);
  }

  &:where([data-with-border]) {
    border: 2px solid var(--mantine-color-body);
  }

  &[data-processing] {
    &::before {
      animation: processing 1000ms linear infinite;
    }
  }
}
